<script setup>
import { ref } from 'vue'
import Form from './11-Form.vue'
const childRef = ref(null)
const getChild = () => {
  // vue2这样写拿到的是子组件的实例，但是vue3不行，因为它压根连this都没有
  //   console.log(this.$refs.childRef)
  console.log(childRef.value.count)
  childRef.value.validate()
}
</script>

<template>
  <div class="">
    Parent
    <Form ref="childRef" />
    <hr />
    <button @click="getChild">get</button>
  </div>
</template>

<style scoped></style>
